﻿// //  ********************************************************************************
// //  Copyright (C) 2016 Sebastian Kenter. All rights reserved.
// // 
// //  Name    : MultiServerEngine | ServerFramework | ITelegramHandlerRegistry.cs
// //  Created : 2016 - 02 - 16 20:53
// //  Modified: 2016 - 02 - 20 12:33
// //  ********************************************************************************

using ExitGames.Logging;
using ServerFramework.Interfaces.Client;
using ServerFramework.Interfaces.Server;
using TypeDefs;

namespace ServerFramework.Interfaces.Handler
{
    /// <summary>
    ///     Interface for the TelegramHandlerRegistry
    /// </summary>
    public interface ITelegramHandlerRegistry
    {
        ILogger Logger { get; }

        bool RegisterServerHandler(ITelegramHandler<IServerPeer> serverTelegramHandler);

        bool UnregisterServerHandler(ITelegramHandler<IServerPeer> serverTelegramHandler);

        bool RegisterClientHandler(ITelegramHandler<IClientPeer> clientTelegramHandler);

        bool UnregisterClientHandler(ITelegramHandler<IClientPeer> clientTelegramHandler);

        ITelegramHandler<IServerPeer> GetServerHandler(TelegramTypes type, byte code, int? subCode);

        ITelegramHandler<IClientPeer> GetClientHandler(TelegramTypes type, byte code, int? subCode);
    }
}
